# -*- coding: utf-8 -*-
import base
from abc import abstractmethod
from  utils.user_check.server import QRServer
from utils.user_temp_mess.server import tempmess



class GetCode(base.BaseHandler):
    @abstractmethod
    def post(self):
        self.acquire_data(
            class_object=QRServer,
            args={'open_id':'open_id'},
            exc_method = 'get_code',
        )


class CodeToUser(base.BaseHandler):
    @abstractmethod
    def post(self):
        self.acquire_data(
            class_object=QRServer,
            args={'code': 'code'},
            exc_method='code_to_user',
        )


class VerifyUserPasswordOpen(base.BaseHandler):
    @abstractmethod
    def post(self):
        self.acquire_data(
            class_object=QRServer,
            args={'uid': 'uid', 'passwd':'passwd', 'cop_id':'cop_id', 'open_id':'open_id'},
            exc_method='verify_user_password_open',
        )

class VerifyUserPasswordMd5(base.BaseHandler):
    @abstractmethod
    def post(self):
        self.acquire_data(
            class_object=QRServer,
            args={'uid': 'uid', 'passwd':'passwd', 'cop_id':'cop_id', 'open_id':'open_id'},
            exc_method='verify_user_password_md5',
        )


class GetOpenId(base.BaseHandler):
    @abstractmethod
    def post(self):
        self.acquire_data(
            class_object=QRServer,
            args={'js_code': 'js_code'},
            exc_method='get_openid',
        )

class UserInfo(base.BaseHandler):
    @abstractmethod
    def post(self):
        self.acquire_data(
            class_object=QRServer,
            args={'open_id': 'open_id'},
            exc_method='get_user_info',
        )


class Schoollist(base.BaseHandler):
    @abstractmethod
    def post(self):
        self.acquire_data (
            class_object=QRServer,
            args={'open_id': 'open_id'},
            exc_method='get_schoollist',
        )


class unbind(base.BaseHandler): #用户解绑
    def post(self):
        self.acquire_data (
            class_object=QRServer,
            args={'uid': 'uid', 'cop_id':'cop_id', 'open_id':'open_id'},
            exc_method='user_unbind',
        )



class sendmess2user(base.BaseHandler): #用户解绑
    def post(self):
        self.acquire_data (
            class_object=tempmess,
            args={'uid': 'uid', 'cop_id':'cop_id'},
            exc_method='send_messtouser',
        )




